package designpatterns.strategy.code;

public class Div implements Strategy {
    @Override
    public Double operation(Double num1, Double num2) {
        if (Double.valueOf(0).equals(num2)) {
            throw new RuntimeException("num2不能为0！");
        }
        return num1 / num2;
    }

    @Override
    public String strategyName() {
        return "/";
    }
}
